<?php
// 获取输入
$input = isset($_POST['input']) ? $_POST['input'] : '';

function delete($Input){
    $filePath = "template/articles_save/" . $Input . ".html";
    if (file_exists($filePath)) {
        unlink($filePath);
        echo "文章删除成功。";
    } else {
        return;
    }
}

delete($input);
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>删除文章</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 20px;
        }
        .form-group {
            margin-bottom: 15px;
        }
        label {
            display: block;
            margin-bottom: 5px;
        }
        .btn {
            display: inline-block;
            padding: 10px 20px;
            font-size: 16px;
            color: white;
            background-color: #007BFF;
            border: none;
            border-radius: 5px;
            text-decoration: none;
            cursor: pointer;
        }
        .btn:hover {
            background-color: #0056b3;
        }
    </style>
</head>
<body>
<h1>删除文章</h1>
<form method="post" action="">
    <div class="form-group">
        <label for="input">文章标题:</label>
        <input type="text" id="input" name="input" required>
    </div>
    <button type="submit" class="btn">删除</button>
</form>
</body>
</html>
